package newcoder;

import java.util.PriorityQueue;

public class NC75 {

    public static int[] FindNumsAppearOnce (int[] array) {
        // write code here
        int sum = 0;
        for(int n:array){
            sum ^= n;
        }
        int i =1;
        while((sum&i)==0){
            i <<= 1;
        }
        int a=0,b=0;
        for(int n:array){
            if((n&i)!=0){
                a^=n;
            }else{
                b^=n;
            }
        }
        return new int[]{Math.min(a,b),Math.max(a,b)};
    }

    public static boolean solve (String A, String B) {
        // write code here
        if(A.length()!=B.length()) return false;
        for(int i = 0;i<A.length();i++){
            if(A.substring(i).equals(B.substring(0,B.length()-i))) return true;
        }
        return false;
    }

    public static void main(String[] args) {
        PriorityQueue<Integer> p = new PriorityQueue<>((a,b)->b-a);
        p.add(2);
        p.add(1);
        System.out.println(p.poll());
        FindNumsAppearOnce(new int[]{1,1,4,6});

        System.out.println(solve("zanyou","youzan"));
    }
}
